
<!-- shayma hesham  This method displays the reviews on tutorials with the name of the Review in a string
		only to the reviewer, creator and the contributor  -->

#{extends 'main.html' /} #{set title:'Home' /}
<html>
<body>

	<!--  start shayma -->

	#{ifnot rev}
	<p>
		<br> ${str}
	</p>
	#{/ifnot}

	<div>

		<h4>
			<u>Review : <br> ${rev.getReview()}
			</u>
		</h4>
		<hr>
		</form>

		<hr>
	</div>
	</form>


	<!--end  shayma -->

	<!-- Ghada Kades viewing a question with the replies on it 
	with displaying the names of the repliers and the dates   -->
	<table border="0">
		<tr>
			<td colspan="2" style="background-color: #FFA500;">
				<h1>Replies</h1>
			</td>
		</tr>
		<tr valign="top">
			<td style="background-color: #778899; width: 200px; text-align: top;">
				#{list items:repliers,as:'replier'}
				<ul>
					<h2>
						<a href="/Application/othersProfile?viewOthers=${replier.id}">${replier.name}</a>
					</h2>
				</ul> #{/list}
			</td>
			<td
				style="background-color: #eeeeee; height: 200px; width: 1000px; text-align: top;">

				#{list items:replies, as:'reply'}
				<h2>${reply.reply}</h2>
				<form action="@{Reviews.viewReplies()}" method="GET">
					<div id="${reply.id}"></div>
				</form> #{/list}
			</td>
		</tr>
	</table>

	<!-- end Ghada Kades -->

	<!-- Dina -->
	<!-- It passes the reply of the user and the review id in the method called replyReview() in Replies 
         by clicking on the reply button. 
     -->
	<form action="@{Reviews.replyReview()}" method="get" NAME="testform">
		<span>#{error 'reply' /}</span><br>
		<textarea name="reply" id="testadvice" rows="7" cols="37"width:100%;> 
</textarea>
		<br>
		<button name="reviewId" type="submit" value="${rev.id}"
			onSubmit="thank u">Reply</button>
		&nbsp;
	</form>

	<!-- It passes the review id to the method called acceptReview() by clicking on the accept button
         and enable the button Publish the tutorial if the clicker is the reviewer.
     -->
	<form action="@{Reviews.acceptReview()}" method="get">
		<button type="submit" name="reviewId" value="${rev.id}">Accept</button>
	</form>



	<!-- It is for the creator to reject the review by clicking the reject button, it passes the review 
	     id in the method rejectReview()in Replies to delete the review.
     -->
	<form action="@{Reviews.rejectReview()}" method="get">
		<button type="submit" name="reviewId" value="${rev.id}">Reject</button>
	</form>

	<br>
	<a href="/Tutorials/tutorialPage?tutId=${rev.getTutId()}">Back to
		the Tutorial Page</a>
	<br>
	<!-- /Dina -->


</body>
</html>
